<?php use_stylesheets_for_form($form) ?>
<form id="UserForm" action="<?php echo url_for('usuario/'.($form->getObject()->isNew() ? 'create'.($sf_request->hasParameter('cita') ? '?cita='.$sf_request->getParameter('cita') : '' ) : 'update').(!$form->getObject()->isNew() ? '?id='.$form->getObject()->getId() : '')) ?>" method="post" <?php $form2->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
<?php if (!$form->getObject()->isNew()): ?>
<input type="hidden" name="sf_method" value="put" />
<?php endif; ?>
  <table>
    <tfoot>
      <tr>
        <td colspan="2">
          &nbsp;<?php echo button_to('Cancelar', 'usuario/index')?>
          <?php if (!$form->getObject()->isNew()): ?>
            &nbsp;<?php //echo link_to('Borrar', 'usuario/delete?id='.$form->getObject()->getId(), array('method' => 'delete', 'confirm' => '&iquest;Seguro?')) ?>
          <?php endif; ?>
          <input type="submit" value="Guardar" />
        </td>
      </tr>
    </tfoot>
    <tbody><?php echo $form1 . $form2 ?></tbody>
  </table>
</form>
<script type="text/javascript">
  document.getElementById('UserForm').onsubmit=function(){
    var i=this.persona_identificacion.value;
    this.sf_guard_user_password.value=i.substring((i.length)-4,i.length);
    this.sf_guard_user_password_again.value=i.substring((i.length)-4,i.length);
  }
</script>